<?php
require('../include/init.inc.php');


$file = ADMIN_BASE . '/config/excels/data.xls';

$excel_array = ExcelReader::readXLS($file);

$output = var_export($excel_array, true);

preg_match_all('/<img.*?src="(.*?)".*?>/is', $output, $array);
$sign = "||";
$i = 0;
$str = "";
foreach ($array[1] as $v) {
    $i++;
    if ($i == count($array[1])) {
        $sign = "";
    }
    $str .= $v . $sign;
}

$data = array("advert_imgs" => $str);
$ret = Shop::updateInfo($data, 5);
if ($ret) {
    exit("成功");
} else {
    exit("失敗");
}